﻿<%@page import="com.hh.bss.util.StringHelper" %>
<%
  String cvId=request.getParameter("cvId");  
  if (StringHelper.isEmpty(cvId)) cvId="0";
   String isEmail=request.getParameter("isEmail");  
  if (StringHelper.isEmpty(isEmail)) isEmail="";
%>   

	
<!DOCTYPE html>  
<html>  
<head>  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
    <meta name="keywords" content="职位候选人推荐">  
    <meta name="description" content="职位候选人推荐">  
    <title>职位候选人推荐管理</title>  
    
    <%@ include file="/WEB-INF/inc/default.jsp"%>
    <jsp:include page="/WEB-INF/inc/dic.jsp"/>


</head>  
<body>  
    
      
    <table id="dg"  style="height:250px"  
            url="/project/contractJobCvRecom/jobcvrecomlist.do?cvId=<%=cvId%>"  
            toolbar="#toolbar" 
            rownumbers="true" fitColumns="true" loadMsg="正在查询,请稍候..." singleSelect="false">  

    </table>  
    <div id="toolbar">  
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="add()">新增</a>  
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="edit()">修改</a>  
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="deletes()">删除</a>  
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="find()">查询</a>
    </div>  
    <!-- edit form窗体（开始） -->  
    <div id="dlg" style="display:none;">  
        <!--    
        <form id="fm" method="post" enctype="multipart/form-data" novalidate>  
        	  	  	 <input type="hidden" name="id" > 
        	  	  	 <input type="hidden" name="cvId" > 
	        		     <div class="fitem">  
                     <label style="width:100px">职位<font color="red">*</font>:</label>                       
                     <input name="jobId" class="easyui-numberbox easyui-validatebox"  required="true">                       
                   </div>	        		     
	        		     
	        		     <div class="fitem">  
                     <label style="width:100px">推荐原因(优势):</label>                                            
                     <input name="recomResult" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">劣势:</label>                                            
                     <input name="recomRisk" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">文件大小:</label>                                            
                     <input name="docSize" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">exportTemplate:</label>                       
                     <input name="exportTemplate" class="easyui-numberbox">                       
                   </div>	        		     
	        		     <div class="fitem">  
                     <label style="width:100px">自动生成的推荐表文件:</label>                                            
                     <input name="exportDoc" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">直接上传的推荐表文件:</label>                                            
                     <input name="uploadDoc" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">uploadDocEn:</label>                                            
                     <input name="uploadDocEn" class="easyui-box">                       
                   </div> 
	        		     
	        		     <div class="fitem">  
                     <label style="width:100px">状态:</label>                       
                     <input name="status" class="easyui-numberbox">                       
                   </div>	        		     
	        		             		     
	        		     <div class="fitem">  
                     <label style="width:100px">summary:</label>                                            
                     <input name="summary" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">是否发推荐信:</label>                       
                     <input name="isEmail" class="easyui-numberbox">                       
                   </div>	        		     
        </form>  
        <div  style="text-align:center">  
          <a href="javascript:void(0)" id="btn-save" class="easyui-linkbutton" iconCls="icon-ok" ">Save</a>  
          <a href="javascript:void(0)" id="btn-close" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>  
        </div>
        -->
    </div>  
    <!-- edit form窗体（结束） -->  
    <!-- query form窗体(开始) -->  
    <div id="dlg_query" style="display:none;">  
    	  <!--
        <div class="ftitle">职位候选人推荐</div>  
        <form id="fm_query" method="post" novalidate>  
            
              
	        		     <div class="fitem">  
                     <label style="width:100px">职位:</label>                       
                     <input name="jobId" class="easyui-numberbox">                       
                   </div>	        		     
	        		           		     
              
              
        </form>
        <div  style="text-align:center">  
          <a href="javascript:void(0)" id="btn-query" class="easyui-linkbutton" iconCls="icon-ok" ">查询</a>  
          <a href="javascript:void(0)" id="btn-query-close" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>  
        </div>  
        -->
    </div> 
    <!-- query form窗体(结束) -->  
    
    <script type="text/javascript">  
        var url;  
        
        var cvId=<%=cvId%>; 
        
        var addWin;
       
		    
		    var queryWin = $.window({
		       		 title:"职位候选人推荐查询",
		       		 tplRef:"dlg_query",//这个属性指定模板id
		       		 height:200,		       		 
		       		 closed:true,		       		 
		       		 onComplete:function(){
		       		 	  //窗口里面的初始化,最好是在这个事件里面进行
		       		 	  var curWin=this;
		       		 	  var doForm=curWin.find('#fm_query');
		       		 	  curWin.doForm=doForm;
		       		 	  this.find("#btn-query-close").click(function(){		       		 	  	
		       		 	  	   curWin.window('close');
		       		 	  });
		       		 	  this.find("#btn-query").click(function(){
		       		 	  			                 		  
		                 		 //var formdata=$('#fm_query').formToArray(); 
		                 		 curWin.window('close');
		                 		 var formdata=curWin.find('#fm_query').formToArray();   		 
		                 		 curWin.openWin.query(formdata);
		              });
		       		   
		       		 }
		    });
        
        
        function add(){         
        	  addWin = $.window({
		      	   	title:"新增职位候选人推荐",
		      	   	url:"/project/contractJobCvRecom/cvRecomInfo.do?cvId="+cvId,
		      	   	isIframe:true,
		      	   	height:580,		      	   	
		      	   	modal:false,		
		      	   	isCloseDestroy:true,    	   	
		      	   	width:800,
		      	   	onComplete:function(jq,iframe){	
		      	   		   //console.log(this);
                     //console.log(iframe);		      	   		   	      	   		
		      	   		   var fwindow = $.window.util.getFrameWindow(iframe);		      	   		
		      	   		   var ijq = fwindow.jQuery;		
		      	   		   var curWin=this;   
		      	   		   
		      	   		   var curWin=this;
					
					           fwindow.closeWin=function(){
					           	   curWin.window('close');
				             };
				             fwindow.refresh=function(){
					           	   if(curWin.openerWin.refresh) curWin.openerWin.refresh();
				             };
		      	   		       	   		
		      	   		   ijq("#btn").click(function(){
		      	   		   	  //alert("这样绑定事件才靠谱!");
		      	   		   	  //保存成功后回调
		      	   		   	  
		      	   		   });
		      	   	}
		      	});  
            addWin.openerWin=window;    
            
        }  
       function doEdit(id){
        	  editWin = $.window({
		      	   	title:"修改职位候选人推荐",
		      	   		url:"/project/contractJobCvRecom/cvRecomInfo.do?type=UPDATE&id="+id,
		      	   	isIframe:true,
		      	   	isCloseDestroy:true,
		      	   	height:580,
		      	   	modal:false,
		      	   	minimizable : true,
		      	   	width:800,
		      	   	onComplete:function(jq,iframe){		      	   		
		      	   		   var fwindow = $.window.util.getFrameWindow(iframe);		      	   		
		      	   		   var ijq = fwindow.jQuery;		
		      	   		   var curWin=this;   
		      	   		   
		      	   		   fwindow.closeWin=function(){
					           	   curWin.window('close');
				             };
				             fwindow.refresh=function(){
					           	   curWin.openerWin.refresh();
				             };
		      	   		       	   		
		      	   		   ijq("#btn").click(function(){
		      	   		   	  //alert("这样绑定事件才靠谱!");
		      	   		   	  //保存成功后回调
		      	   		   	  
		      	   		   });
		      	   	}
		      	});
		      	editWin.openerWin=window;
        }	
        function edit(){  
            //var row = $('#dg').datagrid('getSelected');  
            var rows = $('#dg').datagrid('getSelections');
            if (!rows||rows.length==0){
            	 $.messager.alert('提示','请选择要修改的行','info');
            	 return;
            }
            if (!rows||rows.length>1){
            	 $.messager.alert('提示','不能选择多行','info');
            	 return;
            }
            if (rows){  
                  doEdit(rows[0].id);  
            }  
        }  
       
        function deletes(){  
            var row = $('#dg').datagrid('getSelected');  
            
            var rows = $('#dg').datagrid('getSelections');  

            if (!rows||rows.length==0){
            	 $.messager.alert('提示','请选择要删除的行','info');
            	 return;
            }
            if (rows){  
                $.messager.confirm('重要提示','确定要删除?',function(r){  
                    if (r){  
                        $.post('/project/contractJobCvRecom/delete.do',{ids:getRecordArray(rows,'id').join(',')},function(result){  
                            if (result.success){  
                                $('#dg').datagrid('reload');    // reload the user data  
                            } else {  
                                 
                                $.messager.alert('错误',result.errorMsg,'error'); 
                            }  
                        },'json');  
                    }  
                });  
            }  
        }  
        function refresh(){        	
        	  $('#dg').datagrid('reload');
        }
        function find(){  
              
                //$('#dlg_query').dialog('open').dialog('setTitle','查询');  
                
                //url = '/project/contractJobCvRecom/list.do';  
                 queryWin.window('open');   
                 queryWin.openWin=window; 
              
        } 
        	
        function query(formdata){  
                
                $('#dg').datagrid({
	                  queryParams: array2json(formdata)
                });
              
        }
        
        //生成grid的字段,需要字典的自动转换
        $('#dg').datagrid({
        	   columns:[[
        	   	
        	   	    {field:'jobName',title:'职位', width:100}
        	       	,{field:'jobContacter',title:'客户职位联系人', width:100}
        	       	,{field:'recomDt',title:'推荐日期', width:100}
        	   	    ,{field:'owner_name',title:'职位负责人', width:100}
        	   	    ,{field:'creator',title:'创建人', width:100}
        	   	    ,{field:'mobile',title:'手机', width:100}
        	   	    ,{field:'email',title:'电邮', width:100}
        	   	    ,{field:'custName',title:'客户公司', width:100}
        	   	    
        	   	   ,{field:'modifiedDt',title:'修改时间', width:100}
        	   	   ,{field:'recomResult',title:'优势/强项', width:100}
        	   	    ,{field:'recomRisk',title:'劣势', width:100}
        	   	    
        	   	
        	   	
        	   	
        	   ]]
        	   ,onDblClickRow: function(rowIndex, rowData){        	    	
                 doEdit(rowData.id);  
        	    }
        }); 
        //完成-生成grid的字段
        
        
        
    </script>  
     
     

     
     
     
</body>  
</html>